from django.db import models

from member.models import Member


# Create your models here.
class Investment(models.Model):
    member = models.ForeignKey(Member)
    business = models.CharField(max_length=50)
    description = models.CharField(max_length=200)
    invested_amount = models.IntegerField(max_length=20)
    expected_returns = models.IntegerField(max_length=20)

    class Meta:
        db_table = 'investments'
        ordering = ['invested_amount']

    def endorser(self):
        return u'%s %s' %(self.member.first_name, self.member.last_name)

    def __unicode__(self):
        return self.business
    
